<%-- 
    Document   : product
    Created on : Jul 12, 2011, 7:55:17 AM
    Author     : havn
--%>

<%@include file="page/header.jsp" %>
Cart Count :<c:out value="${cart}"></c:out>

    <table width="100%">
    <c:set var="listsize" value="${f:length(items)}" />
    <c:set var="count" value="1" />
    <c:forEach items="${items}" var="item" step="3" varStatus="status">
        <tr>
            <c:forEach var="i" begin="${0}" end="${2}">
                <td>
                    <c:if test="${status.index + i < listsize}">
                        <c:set var="product" value="${items[status.index+i]}"/>
                        <form action="CartServlet" method="post" id="addCart">
                            <div class="product">
                                <div class="image"><img width="100" src="${product.image}" alt="${product.name}"/> </div>
                                <div class="detail">
                                    ${product.id} <input type="submit" value="buy" />
                                    <input type="hidden" name="id" value="${product.id}"/>
                                    <input type="hidden" name="name" value="${product.name}"/>
                                    <input type="hidden" name="image" value="${product.image}"/>
                                    <input type="hidden" name="price" value="${product.price}"/>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </form>
                    </c:if>
                </td>
            </c:forEach>
        </tr>
    </c:forEach>
</table>
<%@include file="page/footer.jsp" %>